from galaxy import *


class Game(object):

    def __init__(self):
        print "Game initialized"
        self.running = False

    def newGame(self,seed=999):
        self.galaxy = Galaxy(self) 
        if self.galaxy.new(seed) == True:
            self.running = True
            return True
            
    def loadGame(self,filename):
        self.running = True
        if self.galaxy.load(filename) == True:
            self.running = True
            return True
        
    def startGraphicInterface(self):
        import interface_graphic
        self.interface = interface_graphic.InterfaceGraphic(self)
        #self.interface.start()
        self.interface.startNewGame()

    def updateGalaxy(self):
        if self.running: self.galaxy.update()

    def updateAI(self):
        #if self.running: print "Game - updating AI"
        pass
        
        
def main():
    theGame = Game()
    theGame.startGraphicInterface()
